package com.dao.hm;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.entity.Detailedrequirement;

public interface DRequirementDAO extends CrudRepository<Detailedrequirement, Long>,
		JpaRepository<Detailedrequirement, Long>, JpaSpecificationExecutor<Detailedrequirement> {
	@Query("from Detailedrequirement d where d.logic=1")
	public Page<Detailedrequirement> queryNoCriteria(Pageable p);

//	@Query("from Detailedrequirement d where d.drid=?1")
//	public Detailedrequirement findOne(Long drid);

	@Query("from Detailedrequirement d where d.chanceinfo.ciid=?1")
	public List<Detailedrequirement> findSomeByCiid(Long ciid);
	
	@Query("from Detailedrequirement d where d.logic=1 and d.importent=?1")
	public Page<Detailedrequirement> queryFast(String i,Pageable p);
	
	@Query("from Detailedrequirement d where d.logic=1 and d.theme like ?1")
	public Page<Detailedrequirement> queryByTheme(String theme,Pageable p);

}
